﻿
<!DOCTYPE html>
<!--作业许可证管理=》作业许可证申请-->
<html>

<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <script src="/static/js/common.js"></script>
    <link href="../static/js/vue-treeselect/vue-treeselect.css" rel="stylesheet" />
    <script src="../static/js/vue-treeselect/vue-treeselect.js"></script>
    <!--作业票证CSS-->
    <link href="/static/css/jobslip.css" rel="stylesheet" />
</head>

<body>

    <div id="app" v-cloak>
        <div style="width:100%;text-align:center ">
            <label style="font-weight:bold">作业许可证</label>
        </div>
        <div style="width:100%;text-align:right">
            <label>Q/G11-018-R01&nbsp;&nbsp;&nbsp;No.：{{Form.jobLicenseCode}}</label>
        </div>
        <el-form :model="Form" status-icon style="margin-top:5px;width:100%" class="safeCard" size="mini"
                 label-position="right">
            <el-row style="border:1px  solid;  ">
                <!--工作区域-->
                <el-col span="8" class="elst-select-mini">
                    {{JobLicenseManagement.WorkRegion+mark.m}}
                    <tree-area @input="areaChange" v-model="Form.workRegion"></tree-area>
                </el-col>
                <!--负责人-->
                <el-col span="8" class="elst-select-mini">
                    有效期
                    <el-date-picker @blur="datePickerChange" v-model="Form.effectiveStartTime"
                                    type="datetime"
                                    placeholder="选择日期时间"
                                    align="right"
                                    :picker-options="pickerOptions">
                    </el-date-picker>

                </el-col>
                <el-col span="8" class="elst-select-mini">
                    至
                    {{Form.effectiveEndTime}}
                </el-col>
            </el-row>


            <el-row style="border:1px  solid; border-top:0px;  ">
                <!--工作地点-->
                <el-col span="8">
                    <div class="elst-select-mini">
                        <el-form-item>
                            <el-input type="text" v-model="Form.jobLocation" autocomplete="off" size="mini">
                                <template slot="prepend">
                                    {{JobLicenseManagement.JobLocation+mark.m}}
                                </template>
                            </el-input>
                        </el-form-item>
                    </div>
                </el-col>
                <!--作业单位-->
                <el-col span="8">
                    <div class="elst-select-mini">
                        {{'作业单位'+mark.m}}
                        {{Form.jobLicenseUnitText}}
                    </div>
                </el-col>
                <!--负责人/属地主管-->
                <el-col span="8">
                    {{'负责人'+mark.m}}
                    <el-select @visible-change="visibleChange" style="margin-top:3px;" v-model="Form.jobManagerProple">
                        <el-option v-for="item in jobinformation.users" :label="item.name" :value="item.sysUserID"></el-option>
                    </el-select>
                </el-col>
            </el-row>

            <el-row style="border:1px  solid; border-top:0px; ">
                <!--作业人-->
                <el-col span="12">
                    <div class="elst-select-mini">
                        <el-form-item>
                            <el-input type="text" v-model="Form.peopleWork" autocomplete="off" size="mini">
                                <template slot="prepend">
                                    {{JobLicenseManagement.PeopleWork+mark.m}}
                                </template>
                            </el-input>
                        </el-form-item>
                    </div>
                </el-col>
                <!--监护人-->
                <el-col span="11" :offset="1">
                    <div class="elst-select-mini">
                        <el-form-item>
                            <el-input type="text" v-model="Form.guardian" autocomplete="off" size="mini">
                                <template slot="prepend">
                                    {{JobLicenseManagement.Guardian+mark.m}}
                                </template>
                            </el-input>
                        </el-form-item>
                    </div>
                </el-col>
            </el-row>
            <!--工作描述-->
            <el-row style="border:1px  solid; border-top:0px;  ">
                <el-col span="24">
                    <el-form-item label="工作描述：">
                        <el-input type="textarea" v-model="Form.workDescription">
                        </el-input>
                    </el-form-item>
                </el-col>
            </el-row>

            <!--A图纸说明：-->
            <el-row style="border:1px  solid; border-top:0px; ">
                <el-col span="24" style=" font-weight:bold">
                    <el-row>
                        <span class="fl" style="font-size: 14px;margin-top: 5px">
                            A图纸说明：
                        </span>
                        <el-form-item class="fl ml10">

                            <el-input type="text" style="border:none" v-model="Form.DrawingDescription">
                            </el-input>
                        </el-form-item>
                    </el-row>
                    <el-row>
                        是否附安全分析<el-radio v-model="Form.isJSA" :label="true">是</el-radio>
                        <el-radio v-model="Form.isJSA" :label="false">否</el-radio>
                    </el-row>
                    <el-row>

                        是否附图<el-radio v-model="Form.isImages" :label="true">是</el-radio>
                        <el-radio v-model="Form.isImages" :label="false">否</el-radio>
                        <el-input type="textarea" v-model="Form.imagesDescription">
                        </el-input>
                    </el-row>
                    <el-row>
                        <el-col span="24" style="text-align: left;padding: 10px">
                            相关文件附件：<btn-uploadfile-input @success="attchmentSuccess" text="添加" v-if="isSaveState()"></btn-uploadfile-input>
                        </el-col>
                    </el-row>
                    <el-row>

                        <el-table :data="Form.attachment" border>
                            <el-table-column prop="fileName" label="附件名称">
                            </el-table-column>
                            <el-table-column v-if="isSaveState()" label="操作" width="180">
                                <template slot-scope="scope">
                                    <el-button @click.native.prevent="deleteRow(scope.$index, Form.attachment)" type="text"
                                               size="small">
                                        移除
                                    </el-button>
                                </template>
                            </el-table-column>
                        </el-table>
                    </el-row>
                </el-col>
            </el-row>
            <!--相关表格：-->
            <el-row style="border:1px  solid; border-top:0px; ">
                相关表格
            </el-row>
            <el-row style="border:1px  solid; border-top:0px; ">
                <el-row>
                    <el-col span="8">表格名称</el-col>
                    <el-col span="12">文件编号</el-col>
                    <el-col v-if="isSaveState()" span="4">操作</el-col>
                </el-row>
                <el-row>
                    <el-col span="8">安全交底和风险告知卡</el-col>
                    <el-col span="12">{{Form.securityCardCode}}&nbsp;</el-col>
                    <el-col v-if="isSaveState()" span="4"><el-button @click="addCorrelationTable(TableType .SafetyCard)" type="text">查询</el-button></el-col>
                </el-row>
                <el-row>
                    <el-col span="8">特种教育安全培训记录</el-col>
                    <el-col span="12">{{Form.specialEducationCode}}&nbsp;</el-col>
                    <el-col v-if="isSaveState()" span="4"><el-button @click="addCorrelationTable(TableType .SafetyEducation)" type="text">查询</el-button></el-col>
                </el-row>
                <el-row>
                    <el-col span="8">JSA卡</el-col>
                    <el-col span="12">{{Form.jSACardCode}}&nbsp;</el-col>
                    <el-col v-if="isSaveState()" span="4"><el-button @click="addCorrelationTable(TableType .JSA)" type="text">查询</el-button></el-col>
                </el-row>
            </el-row>



            <!--关联票证许可：-->
            <el-row style="border:1px  solid; border-top:0px; " v-if="isSaveState()">
                关联票证许可：
                <el-select @visible-change="visibleChange" style="width:31%;margin-top:3px;" v-model="ticketType">
                    <el-option v-for="item in pageInfo.ticketTypes" :label="item.value" :value="item.key"></el-option>
                </el-select>
                <el-button type="text" @click="createCorrelationTicket">新建票证</el-button>
                <el-button type="text" @click="addCorrelationTicket">添加现有票证</el-button>
            </el-row>
            <el-row style="border:1px  solid; border-top:0px; ">
                <el-col span="24">
                    <el-table :data="Form.SpecialWorkPermitTable" border>
                        <!--作业票编号-->
                        <el-table-column prop="JobTicketName" label="作业票编号">
                        </el-table-column>
                        <!--作业票类型-->
                        <el-table-column prop="JobTicketCode" label="作业票类型" width="180">
                        </el-table-column>
                        <!--作业票有效期-->
                        <el-table-column prop="JobTicketCode" label="作业票有效期" width="180">
                        </el-table-column>
                        <!--状态-->
                        <el-table-column prop="JobTicketCode" label="状态" width="180">
                        </el-table-column>
                        <!--操作-->
                        <el-table-column label="操作" width="180">
                            <template slot-scope="scope">
                                <el-button @click.native.prevent="deleteRow(scope.$index, Form.SpecialWorkPermitTable)"
                                           type="text" size="small">
                                    移除
                                </el-button>
                            </template>
                        </el-table-column>
                    </el-table>
                </el-col>
            </el-row>
            <table style="border:1px  solid; border-top:0px;  border-bottom:0px solid " cellpadding="0" cellspacing="0">
                <tr>
                    <!--B-工作类型：-->
                    <td style="border-right:1px solid; border-bottom:1px solid;">
                        <div style="font-weight:bold;font-size: 14px;margin: 5px 0 0 10px">
                            B-工作类型：(涉及“√”带*须填写相应的作业许可证)
                        </div>
                        <div style="margin: 5px 0 0 10px">
                            <el-checkbox-group v-model="Form.checkJobType_B">
                                <el-checkbox v-for="item in pageInfo.typeB" :label="item.lable">
                                    {{item.text}}
                                </el-checkbox>
                            </el-checkbox-group>
                        </div>
                    </td>
                    <!--C-危害识别：-->
                    <td style="border-right:1px solid ; border-bottom:1px solid">
                        <div style="font-weight:bold;font-size: 14px;margin: 5px 0 0 10px">
                            C-危害识别：(存在“√”)工艺设备、作业工具、作业地点是否存在下列危险（按标准，尽可能全）
                        </div>
                        <div style="margin: 5px 0 0 10px">
                            <el-checkbox-group v-model="Form.checkHazardIdentification_C">
                                <el-checkbox v-for="item in pageInfo.typeB" :label="item.lable" :key="item.key">
                                    {{item.text}}
                                </el-checkbox>
                            </el-checkbox-group>
                            <el-input type="text" v-model="Form.c_other" autocomplete="off" size="mini">
                                <template slot="prepend">
                                    其他
                                </template>
                            </el-input>
                        </div>
                    </td>
                    <!--D-个人安全防护：-->
                    <td style=" border-bottom:1px solid">
                        <div style="font-weight:bold;font-size: 14px;margin: 5px 0 0 10px">
                            D-个人安全防护：（需要“√”）
                        </div>
                        <div style="margin: 5px 0 0 10px">
                            <el-checkbox-group v-model="Form.checkPersonalSecurityProtection_D">
                                <el-checkbox v-for="item in pageInfo.typeD" :label="item.lable">{{item.text}}</el-checkbox>
                            </el-checkbox-group>
                            <el-input type="text" v-model="Form.d_other" autocomplete="off" size="mini">
                                <template slot="prepend">
                                    其他
                                </template>
                            </el-input>
                        </div>
                    </td>
                </tr>

            </table>

            <!--E-工作前安全措施（工作区域准备）：-->
            <el-row style="border:1px  solid; border-top:0px; ">
                <el-col span="24" style="  font-weight:bold">
                    <div style="font-weight:bold;font-size: 14px">
                        E-工作前安全措施（工作区域准备）：）（需要“√”）
                    </div>
                    <div>
                        <el-checkbox-group v-model="Form.checkPreworkSafetyMeasures_E">
                            <el-checkbox v-for="item in pageInfo.typeE" :label="item.lable">
                                {{item.text}}
                            </el-checkbox>
                        </el-checkbox-group>
                        <el-input type="text" v-model="Form.e_other" autocomplete="off" size="mini">
                            <template slot="prepend">
                                其他
                            </template>
                        </el-input>
                    </div>
                </el-col>
            </el-row>


            <!--F-安全措施确认：-->
            <el-row style="border:1px  solid; border-top:0px;  ">
                <el-col span="24" style="font-weight:bold">
                    <div style="font-weight:bold;font-size: 14px">
                        F-安全措施确认：
                    </div>
                    <div>
                        <check-box v-for="item in Form.checkF_PreworkSafetyMeasures_F" v-model="item.value" :label="item.lable" :text="item.text"> </check-box>
                    </div>
                </el-col>
                <el-input type="text" v-model="Form.f_other" autocomplete="off" size="mini">
                    <template slot="prepend">
                        其他
                    </template>
                </el-input>
            </el-row>
            <el-row style="border:1px  solid; border-top:0px; ">
                本人在工作开始前，已同工作区域负责人讨论了该工作及安全工作方案，并对工作内容进行了现场检查，该作业许可证的安全措施已落实
                <!--v-if="Form.jobLicenseState == TickeState.Submit"-->
                <signature v-model="Form.applicantConfirmation" @change="singnatureChange" v-if="!isSaveState()" :disabled="Form.jobLicenseState!=TickeState.Submit"></signature> 签字时间：{{Form.applicantConfirmationDate}}
            </el-row>
            <el-row style="border:1px  solid; border-top:0px; ">
                <el-col span="12" style="  font-weight:bold">
                    <el-row style="border:1px  solid; border-top:10px; ">
                        J-受影响相关方共同签署
                    </el-row>
                    <el-row style="border:1px  solid; border-top:0px; ">
                        本人确定收到许可证，了解工作对本单位的影响，将安排人员对此项工作给与关注，并和相关各方保持联系。
                    </el-row>
                </el-col>
                <el-col span="12" style="  font-weight:bold">
                    <sapn v-if="isSaveState()">
                        <tree-department-staff @select="select"></tree-department-staff> <el-button type="text" @click="addCorrelationUnit">添加</el-button>
                    </sapn>
                    <el-table ref="table" stripe class="tb-edit"
                              :data="Form.jobLicenceCheckList" :row-key="getRowKeys" border @selection-change="handleSelectionChange"
                              row-style="height:10px" style="width: 100%;">

                        <!--相关单位-->
                        <el-table-column prop="departmentName" label="相关单位">
                        </el-table-column>
                        <!--确认人签字-->
                        <el-table-column prop="userName" label="确认人签字" width="180">
                        </el-table-column>
                        <!--操作-->
                        <el-table-column label="操作" width="180">
                            <template slot-scope="scope">
                                <el-button v-if="Form.jobLicenseState==TickeState.Save"  @click.native.prevent="deleteRow(scope.$index, Form.jobLicenceCheckList)"
                                           type="text" size="small">
                                    移除
                                </el-button>
                                <!--v-if="Form.jobLicenseState==TickeState.ApplicantConfirmation"-->
                                <signature :data="scope.row" v-model="scope.row.signaturePicID" @change="correlationUnitSign" v-if="!isSaveState()"  :disabled="Form.jobLicenseState!=TickeState.ApplicantConfirmation"></signature>
                            </template>
                        </el-table-column>
                    </el-table>
                </el-col>
            </el-row>


            <el-row style="border:1px  solid; border-top:0px; ">
                <el-col span="12" style="  font-weight:bold">
                    <el-row style="border:1px  solid; border-top:10px; ">
                        J-审批人批准
                    </el-row>
                    <el-row style="border:1px  solid; border-top:0px; ">
                        本人已同工作执行单位（人员）讨论了该工作及安全工作方案，并对工作内容进行了现场检查，我对本工作及工作人员的安全放在
                    </el-row>
                </el-col>
                <el-col span="12" style="  font-weight:bold">
                    <el-table :data="Form.jobLicenceApproveList" border>
                        <el-table-column prop="dutyName" label="批准人">
                        </el-table-column>
                        <el-table-column label="批准人" width="180">
                            <template slot-scope="scope">
                                <!--v-if="Form.jobLicenseState==TickeState.ApplicantConfirmation"-->
                                <signature v-if="!isSaveState() && scope.row.canApprove" :data="scope.row" v-model="scope.row.signaturePicID" @change="approveSign"   :disabled="Form.jobLicenseState!=TickeState.SignatureOfConfirmer"></signature>
                            </template>
                        </el-table-column>
                    </el-table>
                </el-col>
            </el-row>
            <el-row style="border:1px  solid; border-top:0px; ">
                <el-col span="8" style="  font-weight:bold">
                    <el-row style="border:1px  solid; border-top:10px; ">
                        K-许可证关闭
                    </el-row>
                    <el-row style="border:1px  solid; border-top:0px; ">
                        工作结束，已经确认现场没有遗留任何安全隐患，并已恢复到正常状态，统一许可证关闭。
                    </el-row>
                </el-col>
                <el-col span="8" style="  font-weight:bold">
                    作业负责人
                </el-col>
                <el-col span="8" style="  font-weight:bold">
                    属地主管
                </el-col>
            </el-row>
            <el-row style="border:1px  solid; border-top:0px; ">
                <el-col span="8" style="  font-weight:bold">
                    <el-row style="border:1px  solid; border-top:10px; ">
                        L-许可证的取消
                    </el-row>
                    <el-row style="border:1px  solid; border-top:0px; ">
                        因一下原因，此许可证取消
                    </el-row>
                </el-col>
                <el-col span="8" style="  font-weight:bold">
                    作业负责人：
                </el-col>
                <el-col span="8" style="  font-weight:bold">
                    属地主管负责人：
                </el-col>
            </el-row>
        </el-form>
        <button v-if="isSaveState()" @click="onSubmitForm">提交</button>
        <button v-if="isSaveState()" @click="onSave">保存</button>
        <el-dialog :title="title" :visible.sync="dialogVisible" @close='closeDialog' width="80%" height="80%">
            <iframe ref="iframe" :src="dialogUrl" style="height:700px;width:100%" frameborder="0"></iframe>
        </el-dialog>
    </div>
    <script type="text/javascript">
        var jobinformationModel = {
            department: { name: null, id: null },//部門信息
            users: []//属地主管用户信息
        };

        Vue.component('treeselect', VueTreeselect.Treeselect)
        app = new Vue({
            el: '#app',
            data: {
                initAll: false,
                id: null,
                title: "",
                dialogVisible: false,
                dialogUrl: "/JobSafetyManagement/JSA/jsa.html",
                //dialogUrl: "/index.html",
                dialogType: TableType.JSA,
                ListItem: {},
                Form: {
                    id: guidEmpty,
                    jobLicenseCode: null,
                    WorkRegion: null,//工作区域
                    effectiveStartTime: null,//有效开始时间
                    effectiveEndTime: null,//有效开始时间
                    jobLocation: null,//作业地点
                    jobLicenseUnit: null,//作业单位
                    jobManagerProple: null,//负责人:
                    peopleWork: '',//作业人
                    guardian: '',//监护人
                    workDescription: '',
                    isJSA: false,//是否jsa分析
                    isImages: false,//是否附图片
                    imagesDescription: null,//图片描述
                    attachment: [],//附件
                    securityCardCode: null,//安全交底卡和风险告知确定卡
                    specialEducationCode: null,//特种教育安全培训记录
                    jSACardCode: null,//JSA卡
                    checkJobType_B: [],//工作类型选中
                    checkHazardIdentification_C: [],//危害意识选中
                    c_other: null,
                    checkPersonalSecurityProtection_D: [],//个人安全防护选中
                    d_other: null,
                    checkPreworkSafetyMeasures_E: [],//工作前安全措施（工作区域准备）选中
                    e_other: null,
                    checkF_PreworkSafetyMeasures_F: [],//安全措施确认  选中
                    f_other: null,
                    jobLicenseUnitText: null,
                    jobLicenceApproveList: [],
                    jobLicenceCheckList: [],
                    jobLicenseState: TickeState.Save,
                    applicantConfirmation: null,//申请人签字
                    applicantConfirmationDate: null,//申请人签字时间
                },
                tableDict: [],//基础_作业表格
                //作业信息
                jobinformation: jobinformationModel,
                pageInfo: {
                    typeB: [],
                    typeC: [],
                    typeD: [],
                    typeE: [],
                    typeF: [],
                    ticketTypes: [],
                },
                effectiveStartTime: null,//有效开始时间仅用于计算属性
                ticketType: null,
                jobLicenceCheckNode: null,
                callEdit: true,
            },
            methods: {
                //当前票据是否为保存状态
                isSaveState: function () {
                    return this.Form.jobLicenseState == TickeState.Save;
                },
                //弹窗
                showDialog: function (options) {
                    this.dialogVisible = true;
                    this.title = options.title;
                    this.dialogUrl = options.url;
                },
                //关闭弹窗
                closeDialog: function () {
                    this.dialogVisible = false;
                },
                //相关单位选择
                select(node, data) {
                    var parentLabel = "";
                    for (var i = 0; i < data.length; i++) {
                        var item = data[i];
                        if (node.parentId == item.id)
                            parentLabel = item.label;
                    }
                    this.jobLicenceCheckNode = node;
                    this.jobLicenceCheckNode.parentLabel = parentLabel;
                },
                //相关单位
                addCorrelationUnit: function () {
                    var node = this.jobLicenceCheckNode;
                    this.Form.jobLicenceCheckList.push({
                        userId: node.id,
                        userName: node.label,
                        departmentId: node.parentId,
                        departmentName: node.parentLabel
                    });
                },
                //相关单位签名
                correlationUnitSign: function (fileId, isSignCancel, row) {
                    console.log(row);
                    var signModel = {
                        isCancel: isSignCancel,
                        businessId: row.businessId
                    }
                    var apiUrl = "/api/ZY_license/correlationUnitSign";
                    //var app = this;
                    myAjax("Post", null, apiUrl, signModel, function (response) {
                        var data = response.data;
                        row.signaturePicID = data.signFileId;
                    }, false);
                },
                //审批人审批签名
                approveSign: function (fileId, isSignCancel, row) {
                    console.log(row);
                    var signModel = {
                        isCancel: isSignCancel,
                        businessId: row.businessId
                    }
                    var apiUrl = "/api/ZY_license/ApproveSign";
                    //var app = this;
                    myAjax("Post", null, apiUrl, signModel, function (response) {
                        var data = response.data;
                        row.signaturePicID = data.signFileId;
                    }, false);
                },
                //申请人签名
                singnatureChange: function (fileId, isSignCancel) {
                    var signModel = {
                        isCancel: isSignCancel,
                        businessId: this.Form.id
                    }
                    var apiUrl = "/api/ZY_license/ApplicantConfirmation";
                    var app = this;
                    myAjax("Post", null, apiUrl, signModel, function (response) {
                        var data = response.data;
                        app.Form.applicantConfirmation = data.signFileId;
                        app.Form.applicantConfirmationDate = data.signDate;
                    }, false);
                },
                //相关表格
                addCorrelationTable: function (tableType) {
                    var dialogOptions = {};
                    switch (tableType) {
                        case TableType.JSA:
                            dialogOptions.title = "JSA";
                            dialogOptions.url = "/JobSafetyManagement/JSA/jsa.html";
                            break;
                        case TableType.SafetyCard:
                            dialogOptions.title = "SafetyCard";
                            dialogOptions.url = "/JobSafetyManagement/JSA/SafetyCard.html";
                            break;
                        case TableType.SafetyEducation:
                            dialogOptions.title = "SafetyEducation";
                            dialogOptions.url = "/JobSafetyManagement/JSA/SafetyEducation.html";
                            break;
                        default:
                    }
                    this.showDialog(dialogOptions);
                },
                //添加现有票据
                addCorrelationTicket: function () {
                    var dialogOptions = {};
                    switch (this.ticketType) {
                        case TicketType.Workermit:
                            dialogOptions.title = "JSA";
                            dialogOptions.url = "/JobSafetyManagement/JSA/jsa.html";
                            break;
                        default:
                    }
                    this.showDialog(dialogOptions);
                },
                //创建票据
                createCorrelationTicket: function () {
                },
                //解決edge下select bug
                visibleChange: function (isVisible) {
                    visibleChange(isVisible)
                },
                deleteRow: function (index, rows) {
                    rows.splice(index, 1);
                },
                //提交数据
                onSubmitForm: function () {
                    var mythis = this;
                    onSubmitForm(this, '/api/ZY_license/submit', mythis.Form);
                },
                //保存
                onSave: function () {
                    var mythis = this;
                    onSubmitForm(this, '/api/ZY_license/Save', mythis.Form);
                },
                //获取许可证编号
                jobLicenseCode: function () {
                    var app = this;
                    var apiUrl = "/api/JobSlip/jobLicenseCode"
                    myAjax("get", null, apiUrl, null, function (response) {
                        app.Form.jobLicenseCode = response.data;
                    }, false);
                },
                //基础信息获取
                getData: function () {
                    getData(this, '/api/ZY_license/get?id=' + this.id);
                },
                //字典类型
                jobDic: function () {
                    var app = this;
                    var apiUrl = "/api/JobSlip/PageInit"
                    myAjax("get", null, apiUrl, null, function (response) {
                        app.pageInfo = response.data;
                        if (!this.id)//仅在修改时采用dic表基础数据，
                            app.Form.checkF_PreworkSafetyMeasures_F = app.pageInfo.typeF;
                    }, false);
                },
                //获取当前登录用户部门信息
                getJobinformation: function () {
                    var app = this;
                    var apiUrl = "/api/JobSlip/jobinformation/" + this.Form.workRegion;
                    myAjax("get", null, apiUrl, null
                        , function (response) {
                            app.jobinformation = response.data;
                            app.Form.jobLicenseUnit = app.jobinformation.department.id;
                            app.Form.jobLicenseUnitText = app.jobinformation.department.name;
                        }
                        , false
                        //ajax异常后清空已有信息
                        , function (response) {
                            app.jobinformation = jobinformationModel;
                            showMessage(response.message, 'error')
                        });
                },
                //附件上传
                attchmentSuccess: function (response, id, fileName, data) {
                    this.Form.attachment.push(data[0]);
                },
                //获取批准人签字
                jobLicenceApprove: function (type) {
                    if (this.id && !this.initAll)
                        return;
                    var app = this;
                    if (!this.Form.effectiveStartTime && !this.Form.workRegion)
                        return;
                    var apiUrl = "/api/ZY_TableApproveProcess/JobLicenceApprove/" + this.Form.workRegion + "/" + this.Form.effectiveStartTime.format("yyyy-MM-dd hh:mm:ss");
                    myAjax("get", null, apiUrl, null, function (response) {
                        var model = response.data;
                        app.Form.jobLicenceApproveList = [];
                        app.Form.jobLicenceApproveList.push(model);
                    }, false);
                },
                //区域更改Event
                areaChange: function () {
                    this.getJobinformation();
                    this.jobLicenceApprove("areaChange");
                },
                //日期选中事Event
                datePickerChange() {
                    var val = this.Form.effectiveStartTime;
                    var endTime = new Date(val);
                    endTime.setDate(val.getDate() + 1);
                    console.log(val);
                    this.Form.effectiveEndTime = endTime.format("yyyy-MM-dd hh:mm:ss");
                    this.jobLicenceApprove("datePickerChange");
                }
            },
            mounted: function () {
                this.id = getUrlParam("id");
                this.jobDic();
                if (this.id)
                    this.getData();
                else
                    this.jobLicenseCode();
                this.$nextTick(function () {
                    this.initAll = true;
                })
            }
        });
    </script>
</body>
</html>